This Quarto computational documents includes post-processing of
already clustered Xenium data generated using
process_Xenium_data.R script. This post-processing
includes
Loading required libraries
library(ggplot2, lib.loc = "/beegfs/homes/skulkarni/R/x86_64-pc-linux-gnu-library/4.3")
library(Seurat, lib.loc = "/beegfs/homes/skulkarni/R/x86_64-pc-linux-gnu-library/4.3")
library(patchwork)
library(markdown)
library(rmarkdown)
library(dplyr, lib.loc = "/beegfs/homes/skulkarni/R/x86_64-pc-linux-gnu-library/4.3")
library(presto, lib.loc = "/beegfs/homes/skulkarni/R/x86_64-pc-linux-gnu-library/4.3")
library(stringr)
Read the merged and processed Xenium data for slide 18072
xenium.obj_18072 <- readRDS("/prj/XeniumProbeDesign/kidney_Nphs2-mice_Xenium_Martin/xenium_objects_R/0018072_merged_processed.rds")
I originally retain all cells. So here I filter for cells with low total counts
xenium.obj_18072 <- subset(xenium.obj_18072, nCount_Xenium > 65)
Finding marker genes using presto package (much faster than Seurat functions)
all_markers_18072 <- presto::wilcoxauc(xenium.obj_18072, seurat_assay = "SCT", group_by = "seurat_clusters")
write.csv(all_markers_18072, "/prj/XeniumProbeDesign/kidney_Nphs2-mice_Xenium_Martin/xenium_objects_R/0018072_merged_markergenes.csv", quote = F)
Dimplot
DimPlot(xenium.obj_18072, label = T, label.size = 5) | ImageDimPlot(xenium.obj_18072)
## Warning: No FOV associated with assay 'SCT', using global default FOV
nCount and nFeature plots to see gene counts
VlnPlot(xenium.obj_18072, c("nCount_Xenium", "nFeature_Xenium"), pt.size = 0)
Check circle versus linear expression present in each cell. For this, subset the seurat object for circle and linear
all_panel <- rownames(xenium.obj_18072[["SCT"]]$counts)
circles <- all_panel[grepl("*-BSJ*", all_panel)]
linears <- setdiff(all_panel, circles)
subset_matrix_circle <- xenium.obj_18072[["SCT"]]$counts[circles,]
subset_matrix_linear <- xenium.obj_18072[["SCT"]]$counts[linears,]
object_circle <- CreateSeuratObject(subset_matrix_circle)
object_linear <- CreateSeuratObject(subset_matrix_linear)
Distributions of nCount and nFeatures for linear and circular RNAs
boxplot(object_circle$nCount_RNA, object_linear$nCount_RNA, names = c("Circle", "Linear"), col = c("red","blue"), main = "Total counts per cell")
boxplot(object_circle$nFeature_RNA, object_linear$nFeature_RNA, names = c("Circle", "Linear"), col = c("red","blue"), main = "#RNA molecules per cell")
Featureplot function with ImageDimPlot
plot_featureplots <- function(gene){
p1 <- FeaturePlot(xenium.obj_18072, c(gene), label = T) + labs(title = "On UMAP Level")
p2 <- ImageFeaturePlot(xenium.obj_18072, features = gene, dark.background = F) + labs(title = "On Spatial Level")
return(p1 | p2)
}
AVN subtypes from Kanemaru et al., 2023 https://www.nature.com/articles/s41586-023-06311-1
FeaturePlot(xenium.obj_18072, c("TTN-FSJ3", "TNNT2-FSJ3"), label = T, label.size = 5)
Cardiomyocytes
FeaturePlot(xenium.obj_18072, c("ACTA2"), label = T, label.size = 5)
AVN-Bundle cells
FeaturePlot(xenium.obj_18072, c("LTBP2", "FBLN1"), label = T, label.size = 5)
Endothelial cells
FeaturePlot(xenium.obj_18072, c("VWF", "PECAM1"), label = T, label.size = 5)
Macrophages
FeaturePlot(xenium.obj_18072, c("CD14", "MS4A6A"), label = T, label.size = 5)